#include "stdafx.h"
#include "CursorNameMap.h"


CursorNameMap* CursorNameMap::mapSingleton = NULL;

CursorNameMap::CursorNameMap(void) : kindNameMap()
{

}

CursorNameMap::~CursorNameMap(void)
{
}


CursorNameMap* CursorNameMap::initCursorNameMap(void){
	if (mapSingleton == NULL){
		CursorNameMap();
		mapSingleton->fill();
	}
	return mapSingleton;
}


bool CursorNameMap::addEntry(CXCursorKind kind, std::string name){
	return (kindNameMap.insert(std::pair<CXCursorKind,std::string >(kind, name)).second);
}


std::string CursorNameMap::getName(CXCursorKind kind){
	std::map<CXCursorKind,std::string>::iterator mapIter= kindNameMap.find(kind);
	if (mapIter == kindNameMap.end()){
		std::stringstream strm;
		strm << "kind not found: " << (unsigned long) kind;
		return strm.str();
	}
	else
		return (*mapIter).second;
}

void CursorNameMap::fill(void){
	return;
}